package com.dh.project.controller;

import com.dh.project.model.ServiceProject;
import com.dh.project.other.ModelRes;
import com.dh.project.service.ServiceProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by admin on 2017/4/25.
 */
@Controller
public class RepairsController {

    @Autowired
    ServiceProjectService serviceProjectService;
    /**
     * 查询产品详情
     * @param service_id
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "selectServiceProjectById",produces = "text/html;charset=utf-8")
    public Object selectServiceProjectById(int service_id){
        ServiceProject serviceProject = serviceProjectService.selectById(Long.valueOf(service_id));
        return new ModelRes(ModelRes.Status.SUCCESS,"查询成功",serviceProject);
    }


    /**
     * 维修价格详情
     * @param service_id
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "selectMaintainById",produces = "text/html;charset=utf-8")
    public Object selectMaintainById(int service_id){
        ServiceProject serviceProject = serviceProjectService.selectById(Long.valueOf(service_id));
        return new ModelRes(ModelRes.Status.SUCCESS,"查询成功",serviceProject);
    }
}